// ml:run = $bin < input
#include <iostream>
#include <algorithm>

struct data
{
    int x, y;
};

data a[2000];
int count[2000];
int n;

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin >> n;
    for (int i = 1; i <= n; i++)
        std::cin >> a[i].x >> a[i].y;
    for (int i = 1; i <= 1826; i++)
        for (int j = 1; j <= n; j++) {
            int l = std::max(i, a[j].x);
            int r = std::min(i + 180 - 1, a[j].y);
            if (l <= r) count[i] += r - l + 1;
        }
    bool ok = true;
    for (int i = 1; i <= 1826; i++)
        if (count[i] > 90) { ok = false; break; }
    if (ok) std::cout << "Yes\n";
    else std::cout << "No\n";
}

